Release 10.1A: OpenEdge Development:
Progress 4GL Reference
– Date subtraction operator
Subtracts a number of days from a date to produce a date result, or subtracts one date from another to produce an integer result that represents the number of days between the two dates.
Syntax
dateAn expression that evaluates to a DATE value.
daysAn expression with a value of the number of days you want to subtract from a
Exampledate.This procedure finds all unshipped orders. If the promised date is more than one week ago, the procedure finds the customers who placed the order and displays the order and customer data.
Notes
- The date subtraction operator rounds days to the nearest integer value.
- To get the number of days between two DATETIME or DATETIME-TZ variable values, use the DATE function. For example:
This operation does not take the time portion into account.
To ensure the correct result when working with two DATETIME-TZ values, convert one of the values to the time zone of the other. For example:
- To subtract a specific number of days or milliseconds from a DATETIME, use the DATETIME function. For example:
The DATETIME function ensures the time portion remains within a valid range by borrowing a day from the date portion, when necessary.
- To subtract a specific number of days or milliseconds from a DATETIME-TZ, use the DATETIME-TZ function. For example:
The DATETIME-TZ function ensures the time portion remains within a valid range by borrowing a day from the date portion, when necessary.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |